package kassiopeia.gui

import java.util.Random;
import org.apache.log4j.Logger;

class LogGeneratorJob {
    private static final Logger log = Logger.getLogger(LogGeneratorJob)
    private static final boolean enabled = false

    static Random random = new Random(new Date().getTime())

    static levels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal']

    static msgs = [
        "Short message",
        """Very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long
         long long long long long long long long long long long long long long long long long long long message""",
        "This is quite usual message, isn't it?"
    ]

    def timeout = 1000l // execute job once in 5 seconds

    def execute() {
        if(!enabled) return
        log.invokeMethod(levels[random.nextInt(5)], msgs[random.nextInt(3)])
    }
}
